package dry.example.disruptor;

import com.lmax.disruptor.EventHandler;

/**
 * 消费者
 *
 * @author zc
 */
public class Consumer implements EventHandler<Message> {

    /**
     * 消费者的唯一编号
     */
    private final int i;

    public Consumer(int i) {
        this.i = i;
    }

    @Override
    public void onEvent(Message message, long l, boolean b) {
        String content = String.format("消费者id=%d message=%s", this.i, message.toString());
        System.out.println(content);
    }

}
